package com.lcf.test;

import com.lcf.demo.Worker;

import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {
//        键盘录入对象
        Scanner input = new Scanner(System.in);
        System.out.println("请输入工人姓名： ");
        String name = input.nextLine();
        System.out.println("请输入工人工龄  ");
        double year = input.nextDouble();
        Worker worker = new Worker(name, year);
        System.out.println("该工人对象信息如下 ");
        System.out.println("姓名" + worker.getName());
        System.out.println("工龄" + worker.getYear());
    }
}
